home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 2004 #6
/
Amiga Plus CD - 2004 - No. 06.iso
/
AmigaPlus
/
Begleitmaterial
/
50Tools
/
Grafik
/
PerfectPaint
/
rexx
/
general
/
InsertPicture.rx
< prev
next >
Wrap
Text File
|
2003-01-07
|
2KB
|
124 lines
/* arexx Script 'Insert Picture' */
options results
parse ARG Port mode b
ADDRESS value Port
pp_GetCurrentBrush; B0=result
pp_FindEmptyBrush; Brush=result
IF Brush=-1 THEN DO; pp_Warn "Can't*find*empty|Brush."; EXIT; END
pp_SetBrush Brush
file2="ram:multifile"
IF OPEN('g',file2, 'R') then DO
file = READLN('g')
call close('g')
END
ELSE
DO
EXIT
END
ADDRESS COMMAND 'delete >nil: ram:multifile'
file2=""
do i=1 to LENGTH(file)
a=SUBSTR(file,i,1)
if a=" " then DO
a="*"
END
file2=file2||a
END
file=file2
pp_BLoad File
pp_GetWidthB; W=result
pp_GetHeightB; H=result
pp_GetWidth; Width=result
pp_GetHeight; Height=result
IF W>0 AND H>0 then DO
pp_GetDepth
IF result<24 then DO
pp_RemapBrush
END
X2=W/2
Y2=H/2
X=Width/2
Y=Height/2
X3=X-X2
Y3=Y-Y2
IF Mode=0 then DO
posx=X2;posy=Y2
END
IF Mode=10 then DO
posx=X;posy=Y2
END
IF Mode=20 then DO
posx=X+X3;posy=Y2
END
IF Mode=3 then DO
posx=X2;posy=Y
END
IF Mode=13 then DO
posx=X;posy=Y
END
IF Mode=23 then DO
posx=X+X3;posy=Y
END
IF Mode=6 then DO
posx=X2;posy=Y+Y3
END
IF Mode=16 then DO
posx=X;posy=Y+Y3
END
IF Mode=26 then DO
posx=X+X3;posy=Y+Y3
END
Ux=posx-W/2-1
Uy=posy-H/2-1
Ux1=Ux+W+2
Uy1=Uy+H+2
if Ux<0 then Ux=0
if Uy<0 then Uy=0
if Ux1>Width-1 then Ux1=Width-1
if Uy1>Height-1 then Uy1=Height-1
pp_UpdateUndoBox Ux Uy Ux1 Uy1
pp_EffectOff
pp_Plot posx posy
END
pp_FreeBrush
pp_SetBrush B0
EXIT